cmake_minimum_required(VERSION 3.23)
project(Proj4 LANGUAGES C)

file( GLOB_RECURSE SRC_DIR_LIST "*.c" )
file( GLOB_RECURSE HEADERS "*.h")
file( GLOB TO_EXCLUDE "cs2cs.c" "cs2cs.c" "geod.c" "nad2bin.c" "nad2nad.c"  "proj.c" )

list(REMOVE_ITEM SRC_DIR_LIST ${TO_EXCLUDE}) 
message(${SRC_DIR_LIST})

add_library(Proj4 SHARED ${SRC_DIR_LIST})
#install(TARGETS Proj4)
install(TARGETS Proj4 
        # for executables and dll on Win
        RUNTIME DESTINATION bin
        # shared libraries
        LIBRARY DESTINATION lib
        # for static libraries
        ARCHIVE DESTINATION lib
        INCLUDES DESTINATION include)
install(FILES ${HEADERS} DESTINATION include )
